<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
    <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
    <!--<script src="http://{$Think.config.google_map_url}" async="async"></script>-->
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->

</head>
<style>
    .layui-upload-img{
        width: 100px;!important;
    }
    .addclassify{
        display: inline-block;
        width: 40px;
        height: 40px;
        border: 1px solid #666;
        line-height: 40px;
        border-radius: 40px;
        text-align: center;
        cursor: pointer;
    }
    .layui-input-inline{
        line-height: 40px;
    }
</style>
<body>
<div style="margin-top: 20px;">
</div>

<form class="layui-form" id="admin">

    <div class="layui-tab layui-tab-card" style="box-shadow:none">
        <ul class="layui-tab-title">
            <li class="layui-this">基础信息</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">

                <div class="layui-form-item">
                    <label class="layui-form-label">fareharborID</label>
                    <div class="layui-input-inline" style="width: 450px">
                    {$goods.item_id}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商品名称</label>
                    <div class="layui-input-inline" style="width: 450px">
                        {$goods.item_name}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">合作商</label>
                    <div class="layui-input-inline" style="width: 450px">
                        {$goods.company}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">headline</label>
                    <div class="layui-input-inline" style="width: 450px">
                        {$goods.headline}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">展示图</label>
                    <div class="layui-input-inline" style="width: 450px">
                        <img src="{$goods.image_cdn_url}" style="width:64px;" alt="">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">简介</label>
                    <div class="layui-input-inline" style="width: 450px">
                        {$goods.description_safe_html}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">详情图</label>
                    <div class="layui-input-inline" style="width: 450px">
                        {volist name='goods.images' id='v'}
                        <img src="{$v.image_cdn_url}" style="width:64px;" alt="">
                        {/volist}
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">地址信息</label>
                    <div class="layui-input-inline" style="width: 450px">
                        {$goods.location}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-inline" style="width: 450px">
                        {$goods.booking_notes}
                </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">退款说明</label>
                    <div class="layui-input-inline" style="width: 450px">
                        {$goods.cancellation_policy_safe_html}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">规格套餐</label>
                    <div class="layui-input-inline" style="width: 600px">
                        <p>
                        <table class="layui-table" lay-even="" lay-skin="line">
                            <colgroup>
                                <col width="8%">
                                <col width="8%">
                                <col width="8%">
                            </colgroup>
                            <thead>

                            <tr>
                                <th>出行人群</th>
                                <th>中文名称</th>
                                <th>成本价（美分）</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name='goods.customer_prototypes' id='vo'}
                            <tr>
                                <td>{$vo.display_name}</td>
                                <td><input type="text" data-ename="{$vo.display_name}" value="{$vo.display_cname}" class="chinesename layui-input"></td>
                                <td>{$vo.total}</td>
                            </tr>
                            {/volist}

                            </tbody>
                        </table>
                        </p>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-inline" style="width: 450px">
                        <a class="layui-btn layui-btn-normal submitChName">提交</a>
                        <span style="color: red;margin-left: 8px;"><i style="margin-right: 4px;" class="layui-icon layui-icon-tips" ></i>修改套餐中文名称</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">税率</label>
                    <div class="layui-input-inline" style="width: 450px">
                        {$goods.tax_percentage}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">更新内容</label>
                    <div class="layui-input-inline" style="width: 450px">
                        {volist name='$update_desc' id='v'}
                        {$v}<br>
                        {/volist}
                    </div>
                </div>
                {if $goods.is_update==1}
                <div class="layui-form-item" id="fareUpdateStatusBtn">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-inline" style="width: 450px">
                        <a class="layui-btn layui-btn-warning modifygoodsupdstatus" data-id="{$goods.fare_goods_id}">我已知晓</a>
                        <span style="color: red;margin-left: 8px;"><i style="margin-right: 4px;" class="layui-icon layui-icon-tips" ></i>修改商品的更新状态为【无】</span>
                    </div>
                </div>
                {/if}

            </div>
        </div>


    </div>

    <!--<div class="layui-form-item">-->
        <!--<div class="layui-input-block">-->
            <!--<button class="layui-btn" lay-submit lay-filter="admin">立即提交</button>-->
            <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
        <!--</div>-->
    <!--</div>-->

</form>

<script src="__PUBLIC__/layui/layui.js"></script>
<script src="__PUBLIC__/jquery/jquery.min.js"></script>
<script>
    var message;
    layui.config({
        base: '__JS__/',
        version: '1.0.1'
    }).use(['app', 'message'], function() {
        var app = layui.app,
            $ = layui.jquery,
            layer = layui.layer;
        //将message设置为全局以便子页面调用
        message = layui.message;
        //主入口
        app.set({
            type: 'iframe',
            width: 300,
        }).init();
    });
</script>
<!-- 配置文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
<script>

    var ue0 = UE.getEditor('jieshao');
    // var jieshao2 = UE.getEditor('jieshao2');
    var yongshi = UE.getEditor('yongshi');
    var baohan = UE.getEditor('baohan');
    var buhan = UE.getEditor('buhan');
    var zhuyi = UE.getEditor('zhuyi');
    var tuigai = UE.getEditor('tuigai');


    function muban(t){
        var op=""
        op+=" <option  value=''>请选择</option>"
        $.each(t,function (i,v) {
            op+="<option value='"+v.id+"'>"+v.name+"</option>"
        })
        return op;
    }

    function team(t){
        var op="";
        op+="  <option value=\"999999\">自营</option>";
        $.each(t,function (i,v) {
            op+="<option value='"+v.id+"'>"+v.name+"</option>"
        });
        op+="  <option value=\"1000000\">其他</option>";
        return op;
    }


    layui.use(['layer', 'form','laydate','layedit'], function() {
        // var laydate = layui.laydate;
        var layer = layui.layer,
            $ = layui.jquery,
            laydate= layui.laydate,
            form = layui.form;
    });

    $(".modifygoodsupdstatus").click(function(){
        var id = $(this).attr("data-id");
        $.post("/admin/faregoods/modifyfareupdstatus",{goods_id:id},function(data){
            layer.msg(data.msg);
            if(data.code==200){
                $("#fareUpdateStatusBtn").remove();
                // window.location.reload();
            }
        },'json')
    })
    $(".submitChName").click(function(){
        var item_id = {$goods.item_id};
        var name = [];
        var data_arr = [];
        var chinesename = $(".chinesename");

        $.each(chinesename,function(i,v){
            name = {}
            name.en_name = $(v).attr('data-ename');
            name.ch_name = $(v).val();
            data_arr.push(name)
        })
        var request = JSON.stringify(data_arr);
        $.post("/admin/faregoods/updfarechname?id="+item_id,{cname:request},function(data){
            layer.msg(data.msg);
            if(data.code==200){
                $("#fareUpdateStatusBtn").remove();
                // window.location.reload();
            }
        },'json')
    })
</script>

<!-- 实例化编辑器 -->
<script type="text/javascript">


</script>
</body>
</html>
